import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.Reader;

public class Homework_1_way_2 {
    public static void main(String[] args){
        //BufferedReader只能读取字符类数据，需要数据转换，需要创建对象
//Creates a buffering character-input stream that uses an input buffer of the specified size.
        BufferedReader re = new BufferedReader(new InputStreamReader(System.in));
        try{
            System.out.println("请输入第一个整数:");
            String a = re.readLine();//读取一行
            int numa = Integer.parseInt(a);//转换成整型

            System.out.println("请输入第二个整数:");
            String b = re.readLine();
            int numb = Integer.parseInt(b);

            System.out.println("两个整数的和为 "+ (numa + numb) );

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}
